feat: Azure DevOps platform adapter — Squad for enterprise#191
feat: Azure DevOps platform adapter — Squad for enterprise#191tamirdresher wants to merge 14 commits intobradygaster:mainfrom
Conversation
…tes (bradygaster#185, bradygaster#188, bradygaster#191, bradygaster#192, bradygaster#195, bradygaster#196, bradygaster#199, bradygaster#201, bradygaster#203, #206, #207) Documentation Epic bradygaster#182 — complete: Docs Content (McManus): - Architecture overview: SDK ↔ CLI ↔ SquadUI system design - Migration guide: Beta → v1 with 10-step checklist - Global CLI install guide: npm, npx, GitHub native - VS Code integration guide: client compatibility, extension patterns - SDK API reference: 574 lines, all 30+ exports documented Docs Site Engine (Keaton): - Static site generator: node docs/build.js → docs/dist/ - GitHub Pages ready, responsive design, sidebar nav - Index landing page linking all guides Mechanical Updates (Fenster): - .ai-team/ → .squad/ across 25 doc files (bradygaster#191) - CLI invocation references verified current (bradygaster#192) - Beta repo URLs updated to squad-pr (bradygaster#195) Docs Tests (Hockney): - 17 docs validation tests: headings, code blocks, links, build - Fixed link checker for parent-dir refs, Windows rmSync Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
a4dcb7f to
fa93a70
Compare
Introduce a platform abstraction layer so Squad works with Azure DevOps (Work Items, PRs, Pipelines) in addition to GitHub (Issues, PRs, Actions). Platform module (packages/squad-sdk/src/platform/): - types.ts: PlatformType, WorkItem, PullRequest, PlatformAdapter interfaces - detect.ts: Auto-detect platform from git remote URL (github/ado) - github.ts: GitHubAdapter wrapping gh CLI - azure-devops.ts: AzureDevOpsAdapter wrapping az CLI - ralph-commands.ts: Platform-specific Ralph triage commands - index.ts: Factory createPlatformAdapter() + barrel exports Coordinator prompt: - Add Platform Detection section to squad.agent.md - ADO command mapping table and prerequisites Tests (57 passing): - Platform detection from various remote URLs - GitHub remote parsing (owner/repo extraction) - ADO remote parsing (org/project/repo extraction) - WorkItem/PullRequest type shape validation - Ralph command generation for both platforms - Edge cases (case insensitivity, unknown platforms) Docs: - docs/features/azure-devops.md: User guide - docs/specs/platform-adapter-prd.md: Design spec Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fa93a70 to
dd3f5d7
Compare
Remove .squad/.first-run and .squad/config.json that trigger branch guard. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add createWorkItem method to PlatformAdapter interface and all adapters: - GitHubAdapter: creates issues via gh issue create - AzureDevOpsAdapter: creates work items via az boards work-item create - PlannerAdapter: creates tasks via Graph API POST /planner/tasks - RalphCommands: add createWorkItem command for all platforms 6 new tests (86 total for platform adapter). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- status.feature: 'Here:' → 'Active squad:' (output format changed) - status-extended.feature: same update + negative assertion fix - init-command.feature: 'Scaffold ready' → 'Your team is ready' (init output changed) These tests were failing for ALL PRs including upstream dev branch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add platform-aware note to Ralph Step 1 scan commands - Include ADO WIQL examples alongside GitHub examples - Add auth section: az login (no PATs), ADO MCP server option - Ralph now knows to check Platform Detection section for command selection Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- ux-gates.test.ts: 'Here:' → 'Active squad:' (same status output change) - status-extended.feature: no-squad dir exit code 0 → 1 - hostile-no-config.feature: 'none' → 'not initialized' for status output Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
5-Model Code Review PR #191 (Updated with test validation)Ran this PR through 5 different AI models (Claude Sonnet 4, Claude Opus 4.5, GPT-5.2, Gemini 3 Pro, Claude Haiku 4.5) for independent review, then wrote unit tests to validate each finding. Only confirmed issues are listed below. ��� Critical Shell Command Injection (5/5 models flagged, confirmed by tests)All adapters build shell commands via string interpolation and run them through Test-proven attack vectors:
This breaks the project's existing norms. The codebase already uses the safe pattern:
Fix: Replace Critical createBranch injection (4/5 models flagged, confirmed by tests)Both adapters run The High confirmed by tests
Medium confirmed by tests
Retracted false positive
What's GoodThe architecture is solid. The |
Address critical review findings from PR bradygaster#191: - All adapter methods now use execFileSync with argument arrays - No user input passes through shell interpretation - Added JSON.parse error handling with raw output in messages - createBranch uses execFileSync('git', [...]) instead of string concat - Follows existing codebase patterns (upstream.ts, rc-tunnel.ts, aspire.ts) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Thanks for the thorough 5-model review @wiisaacs — really appreciate the rigor, especially writing tests to validate each finding! Fixed in latest push (20af91a):
Acknowledged but deferred:
Thanks again — the injection findings were spot-on. |
|
Thanks @tamirdresher the Ran the updated code through the same 5-model review and two findings came back as not fully addressed yet: 1. WIQL query injection (5/5 models flagged)The conditions.push(`[System.State] = '${options.state}'`);
conditions.push(`[System.Tags] Contains '${tag}'`);A value like Likely fix: escape single quotes per WIQL syntax ( 2. Bearer token still visible in process args (4/5 models flagged)
Easiest fix would be swapping curl for Node's native Everything else looks great the |
- WIQL injection: escape single quotes in state/tags/project values - Bearer token: pass via curl --config stdin instead of CLI args - Addresses follow-up review from PR bradygaster#191 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Both addressed in latest push (5daf83e):
Thanks for the follow-up — both were good catches at the right layer. |
The upstream command (add/remove/list/sync) was fully implemented in upstream.ts but never registered in cli-entry.ts, so running 'squad upstream' returned 'Unknown command'. Added routing and help text. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Bug 1: squad init now detects ADO from git remote and skips .github/workflows/ - Bug 2: config.json includes platform field when ADO detected - Bug 3: MCP config template uses platform-appropriate example Reported by ADO integration tester. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…oject support Add AdoWorkItemConfig interface supporting enterprise ADO scenarios: - defaultWorkItemType: configure Scenario, Bug, etc. (default: User Story) - areaPath: route work items to specific team backlogs - iterationPath: place work items in specific sprints - org/project: support work items in a different ADO project/org than the git repo (common in large enterprises) Config lives in .squad/config.json under the 'ado' key. All fields are optional — omitted fields use sensible defaults. Work item operations (create, list, get, tag, comment) now use separate workItemArgs that resolve org/project from config, while repo operations (PRs, branches) continue using the git remote's org/project. - 92 platform adapter tests pass (6 new) - Updated enterprise-platforms.md with config table - squad init writes ado section template for ADO repos Addresses bradygaster#240 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Covers auto-detection, configurable work item types, area/iteration paths, cross-project work items, security hardening, and integration test results. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…g.json Ralph's coordinator prompt now explicitly instructs the coordinator to: 1. Read .squad/config.json BEFORE running any ADO work item commands 2. Use ado.org/ado.project for work item queries (may differ from repo) 3. Pass --org and --project flags on every az boards command 4. Use ado.defaultWorkItemType when creating work items 5. Never guess the ADO project from the repo name — read the config This fixes the issue where Ralph on ADO repos would try the repo name as the ADO project (e.g. 'squad-ado-test') instead of the actual configured work item project. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The governance file (.github/agents/squad.agent.md) that controls the coordinator at runtime had ZERO Azure DevOps awareness. Ralph only knew GitHub commands (gh issue list, gh pr list). Even with a perfect ADO adapter, Ralph would still scan GitHub because the governance file told it to. Changes to .github/agents/squad.agent.md: - Add azure-devops-* to MCP tool detection table - Add Platform Detection section (GitHub vs ADO vs Planner) - Add ADO config resolution from .squad/config.json ado section - Make Issue Awareness section platform-aware (GitHub + ADO queries) - Make Ralph Step 1 platform-aware with both GitHub and ADO command blocks, plus critical instruction to read config first - Update merge PR trigger to include ADO equivalent Also updated blog post bradygaster#23 with 'Ralph + ADO: The Governance Fix' section explaining why this class of bug is invisible in unit tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… fix Session: 2026-03-07T16-19-00Z-pre-release-triage Requested by: Brady (Team Coordinator) Changes: - Merged decisions from 3 agent triage sessions (Keaton, Hockney, McManus) - Brady directives: SDK-First v0.8.22 commitment, Actions-to-CLI strategic shift - Updated agent history.md with cross-team context propagation - Decisions logged: v0.8.21 release gate, PR holds for v0.8.22, docs readiness Results: - v0.8.21: GREEN LIGHT (pending #248 fix per Keaton override) - v0.8.22 roadmap: 9 issues, 3 parallel streams - Close: #194 (completed), #231 (duplicate) - PRs #189/#191: Hold for v0.8.22 (rebase to dev) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Azure DevOps Platform Adapter
Problem
Squad is tightly coupled to GitHub (Issues, Labels, PRs, Actions). Many enterprise teams use Azure DevOps. Ralph can't scan ADO work items, the coordinator can't create ADO PRs, and the triage workflows don't work with ADO.
Solution
Add a platform adapter abstraction that lets Squad work with both GitHub and Azure DevOps.
Platform Adapter (
packages/squad-sdk/src/platform/)PlatformAdapterinterface: listWorkItems, createPR, mergePR, addTag, etc.GitHubAdapter: wraps existingghCLI callsAzureDevOpsAdapter: usesaz devopsCLI / REST APIdetectPlatform(): auto-detect from git remote URL (github.com vs dev.azure.com)getRalphScanCommands(): platform-specific Ralph commandsConcept Mapping
ghCLIaz devopsCLICoordinator (
templates/squad.agent.md)Tests: 57 new tests — platform detection, remote URL parsing, adapter interfaces, Ralph command generation
Docs: Feature guide + PRD
Files
packages/squad-sdk/src/platform/(types, detect, github, azure-devops, ralph-commands, index)Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com